﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuestionnaireOnline.aspx.cs" Inherits="ZX.WebApp.TR.QuestionnaireOnline" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function document.oncontextmenu() {
            event.returnValue = false; //屏蔽鼠标右键
        } 

        function closeWins() {
            parent.closeD5();
        }

        function SubmitTemp() {
            var btnTemp = document.getElementById("btnSave");
            if (btnTemp == null || btnTemp == undefined) {
                alert("还未开始问卷，不能提交，请点击开始问卷");
                return;
            } else {
                if (confirm("提交后无法修改，您确定提交吗？")) {
                    __doPostBack("btnSave", "");
                } 
            }
        }
    </script>
    <style type="text/css">
        body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
        .alg{text-align:center;}
        /* Table样式 */
        .tableContent
        {
            width: 100%;
            border-collapse: collapse;
        }
         .style80
        {
            border-top-style: none;
            border-right-style: none;
            border-left-style: none;
            border-bottom-style: none;
            background-color: transparent;
            height: 20px;
            width: 93%;
        }
        .tableContent td
        {
            border: solid 1px #D4DBE2;
            background-color: #F2F8FF;
            line-height: 28px;
            text-align: center;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="tableContent">
            <tr>
                <td colspan="4">
                    <asp:Label ID="lblWjName" runat="server" Text="问卷名称"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; width: 75px;">
                    发起部门：
                </td>
                <td style="text-align: left">
                    <asp:Label ID="txtDept" runat="server"></asp:Label>
                </td>
                <td style="text-align: right">
                    时长：
                </td>
                <td style="text-align: left">
                    <asp:Label ID="txtTime" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    题目总数：
                </td>
                <td style="text-align: left">
                    <asp:Label ID="txtSum" runat="server"></asp:Label>
                </td>
                <td style="text-align: right">
                    总分数：
                </td>
                <td style="text-align: left">
                    <asp:Label ID="txtPoint" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    问卷目的：
                </td>
                <td colspan="3" style="text-align: left">
                    <asp:Label ID="txtAim" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    问卷须知：
                </td>
                <td colspan="3" style="text-align: left">
                    <asp:Label ID="txtKnown" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    答题类型：
                </td>
                <td style="text-align: left;" colspan="2">
                    <asp:RadioButtonList ID="rbtnSelect" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rbtnSelect_SelectedIndexChanged"
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">列表答题</asp:ListItem>
                        <asp:ListItem Value="1">单题答题</asp:ListItem>
                    </asp:RadioButtonList> 
                </td>
                <td style="text-align: right; padding-right: 16px;">
                    <asp:Button ID="btnBegin" runat="server" Text="开始问卷" CausesValidation="False" OnClick="btnBegin_Click" />&nbsp;&nbsp;<input type="button" id="btnSubmitTemp" value="提交" onclick="SubmitTemp()" />
                </td>
            </tr>
            <tr>
            <td colspan="4">
            <asp:Label ID="lblShow" Text="" runat="server"></asp:Label>
            </td>
            </tr>
        </table>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>                       
            <table align="center" class="tableContent">
                <tr>
                    <td>   
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:Panel ID="pnlList" CssClass="alg" Visible="false" runat="server"> 
                                <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"></asp:Timer>
                                <span>
                                    开始时间为：<label style="color: Red"><%=startTime%></label>&nbsp;&nbsp;
                                    时长：<label style="color: Red"><%=longTime %></label>(分钟)&nbsp;&nbsp;
                                    倒计时：<label style="color: Red"><%=message%> &nbsp;&nbsp;<b>如果时间达到规定时间，系统自动提交</b></abel>
                                </span> 
                            </asp:Panel>
                        </ContentTemplate>  
                        </asp:UpdatePanel>
                        <asp:Panel ID="pnlEn" CssClass="alg" runat="server">
                        <asp:Repeater ID="rptList" runat="server" OnItemDataBound="rptList_ItemDataBound">
                            <HeaderTemplate>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table class="tableContent">
                                    <tr>
                                        <td style="text-align: right"><%#Eval("sequence") %>：</td>
                                        <td colspan="3" style="text-align: left">
                                            <asp:Label ID="lblType" runat="server" Text='<%#Eval("SubjectType")%>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr style="display:none;">
                                        <td style="text-align: right">题目名称：</td>
                                        <td colspan="3" style="text-align: left"><%#Eval("SubjectName") %></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: right">题目内容：</td>
                                        <td colspan="3" style="text-align: left">
                                            <%#Eval("SubjectContent")%> 分数(<%#Eval("SubjectPoint")%>) <%#GetIsJump(Eval("IsJumpOver"))%> 
                                        </td>
                                    </tr>
                                    <tr style='display: <%#((Eval("SubjectType").ToString()=="单选题")||(Eval("SubjectType").ToString()=="多选题"))?"":"none"%>'>
                                        <td style="text-align: right">
                                            选项内容：
                                        </td>
                                        <td colspan="3" style="text-align: left">
                                            <asp:Repeater ID="rptItem" runat="server">
                                                <ItemTemplate>
                                                <%#Eval("ItemCode")%>
                                                .&nbsp;<%#Eval("SunjectItem")%><br />                                                  
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: right;width:75px;">
                                            您的答案：
                                        </td>
                                        <td colspan="3" style="text-align: left">
                                            <asp:RadioButtonList ID="rbtnAnswer" runat="server" Visible="false" RepeatDirection="Horizontal"></asp:RadioButtonList>
                                            <asp:CheckBoxList ID="chkAnswer" runat="server" Visible="false" RepeatDirection="Horizontal"></asp:CheckBoxList>
                                            <asp:TextBox ID="txtAnswer" runat="server" Height="50px" TextMode="MultiLine" Width="474px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: right">
                                            说明：
                                            <asp:HiddenField ID="hdnQid" runat="server" Value='<%#Eval("TrSubjectInfoID")%>'></asp:HiddenField>
                                            <asp:HiddenField ID="hdnQsid" runat="server" Value='<%#Eval("TrQuestionnaireSubjectID")%>'></asp:HiddenField>
                                            <asp:HiddenField ID="hdnJump" runat="server" Value='<%#Eval("IsJumpOver")%>'></asp:HiddenField>
                                        </td>
                                        <td colspan="3" style="text-align: left">
                                            <asp:TextBox ID="txtExplain" CssClass="style80" runat="server" Text='<%#Eval("Explain") %>' Visible="false"></asp:TextBox>  
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">&nbsp;</td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                            <FooterTemplate>
                            </FooterTemplate> 
                        </asp:Repeater>   </asp:Panel> 
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="text-align: right; padding-right: 16px;">
                        <asp:Button ID="btnPre" runat="server" Text="上一题" Visible="false" Enabled="true" OnClick="btnPre_Click" />
                        <asp:Button ID="btnNext" runat="server" Text="下一题" Visible="false" OnClick="btnNext_Click" />
                        <asp:Button ID="btnSave" runat="server" Text="提交" Visible="false" CausesValidation="false" OnClick="btnSave_Click" OnClientClick="return confirm('提交后无法修改，您确定提交吗？') " />

                    </td>
                </tr>
            </table>
             
    </div>
    </form>
</body>
</html>
